var video=$('video').get(0);
function foramtTime(time){
	var h =Math.floor(time/3600);
	var m =Math.floor(time/3600/60);
	var s =Math.floor(time%60);
	return(h<10?"0"+h:h)+":"+(m<10?"0"+m:m)+":"+(s<10?"0"+s:s);
}





video.oncanplay=function(){
	console.log('视频可以播放两次');
	$('video').show();
	console.log(video.duration);
	var totalTime=formatTime(video.duration);
	console.log(totalTime);
	$('.total').html(totalTime);
}
$('.switch').on('click',function(){
	console.log('你被点击到了...');
	if ($(this).hasClass('fa-play')){
		video.play();
		console.log('播放视频...');
		$(this).addClass('fa-play').removeClass('fa-pause');
	}
	
})
video.oncanplay=function(){
	console.log(video.currentTime);
	var ct=formatTime(video.duration);
	console.log(totalTime);
	$('video').show();
	console.log(video.duration);
	var totalTime=formatTime(video.duration);
	console.log(totalTime);
	$('.total').html(totalTime);
}
$('.bar').on('click',function(event){
	if($(this).hasClass('fa-arrows-alt')){
		video.webkiRequestFullScreen();
		console.log('全屏显示');
		$(this).addClass('fa-arrows-alt').removeClass('fa-compress');
	}else{
		document.webkiRequestFullScreen();
		$(this).addClass('fa-arrows-alt').removeClass('fa-compress');
	}
})
$('.expand').on('click',function(){
	if($(this).hasClass('fa-arrows-alt')){
		video.webkiRequestFullScreen();
		console.log('全屏显示');
		$(this).addClass('fa-arrows-alt').removeClass('fa-compress');
	}else{
		document.webkiRequestFullScreen();
		$(this).addClass('fa-arrows-alt').removeClass('fa-compress');
	}
})